home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-04-20 | 1.1 KB | 57 lines | [TEXT/PJMM] |
- unit MyHandleQuitBoth;
-
- { This program was written by Peter N Lewis, Mar 1992 in THINK Pascal 4.0.1 }
-
- interface
-
- procedure InitQuitBoth (creator: OSType);
- procedure FinishQuitBoth;
-
- implementation
-
- uses
- BaseGlobals, MySystem7, MyFMenus, AppGlobals;
-
- var
- quitBoth: boolean;
- creatorType: OSType;
-
- procedure DoQuit;
- begin
- quitNow := true;
- if quitBoth then
- QuitApplication(creatorType);
- end;
-
- procedure SetQuit (themenu, theitem: integer);
- var
- dummyb: boolean;
- er: eventRecord;
- nqb: boolean;
- process: processSerialNumber;
- s: str255;
- begin
- dummyb := GetOSEvent(0, er);
- nqb := (BAND(er.modifiers, optionKey) <> 0) & GetPSN(creatorType, process);
- if nqb <> quitBoth then begin
- quitBoth := nqb;
- if quitBoth then
- GetIndString(s, quitBothStrhID, quitBothQuitBothStrhIndex)
- else
- GetIndString(s, quitBothStrhID, quitBothQuitStrhIndex);
- SetItem(GetMHandle(themenu), theitem, s);
- end;
- end;
-
- procedure InitQuitBoth (creator: OSType);
- begin
- quitBoth := false;
- creatorType := creator;
- SetFBoth(CQuit, @DoQuit, @SetQuit);
- end;
-
- procedure FinishQuitBoth;
- begin
- end;
-
- end.